#include "StdAfx.h"
#include "AdditiveSynth.h"


CAdditiveSynth::CAdditiveSynth(void)
{
	mSamples = NULL;
	mNumSamples = 0;
}

CAdditiveSynth::~CAdditiveSynth(void)
{
}

void CAdditiveSynth::Start()
{
	mPosition = 0;
}

/** Generates a sample.
* Looks up a wave from the wavetable and sets it in the frame.
*/
bool CAdditiveSynth::Generate()
{
	// Get the current sample from the wavetable
	mFrame[0] = mSamples[mPosition++ % mNumSamples];
	mFrame[1] = mFrame[0];

	return true;
}